package com.ys.controller.api.outer;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ys.service.sys.YsSynService;

@Controller
@RequestMapping("/api/outer/syn")
public class ApiOuterSynController {
	
    @Autowired
    private YsSynService ysSynService;

	/*
	 * 从测试端同步
	 */
	@PostMapping("/synFromTest")
	@ResponseBody
	public void synFromTest(@RequestBody String body,Integer type) {
		System.out.println("通知内容body---" + body);
		System.out.println("通知内容type---" + type);
//    	logger.info("通知内容body---" + body);
//    	logger.info("通知内容type---" + type);
		
		if (body == null || body.length() == 0) {
			return;
		}
		ysSynService.syn(type, body);
	}
	
}
